package com.dz.Mapper;

import com.dz.domain.emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface empDao {

    @Select("select * from testvue where name = #{name}")
    public emp findEmp(String empName);

    @Delete("delete from testVue where emp_id = #{emp_id}")
    public int removeUser(int empId);

    @Update("UPDATE testVue SET " +
            "name = #{name}, address = #{address}, age = #{age}, sex = #{sex}, birth = #{birth}" +
            " WHERE emp_id = #{emp_id}")
    public int updateEmp(emp e);

    /**
     * 动态查询所有用户
     * */
    public List<emp> findEmpAll(emp e);
}
